<?php

/*
 * 新锐微信登录 [ 深圳市新锐创意科技有限公司旗下产品 ]
 * Copyright  2015-2099 www.xinruiweb.com  All Rights Reserved.
 * 技术开发: 75674952@qq.com
 * 请支持正版授权产品
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

class table_xinrui_qq_user extends discuz_table {

	public function __construct() {
		$this->_table = 'xinrui_qq_user';
		$this->_pk = 'id';

		parent::__construct();
	}

    public function fetch_first_by_uid($uid) {
        return DB::fetch_first("SELECT * FROM %t WHERE uid=%s", array($this->_table, $uid));
    }

    public function fetch_first_by_openid($openid) {
        return DB::fetch_first("SELECT * FROM %t WHERE openid=%s", array($this->_table, $openid));
    }

	public function update_by_openid($openid, $data) {
	    return DB::update($this->_table, $data, array('openid' => $openid));
	}

}